﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Aima.NET.Test.Core.Agent.Impl
{
    using Aima.Core.Agent.Impl;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class DynamicPerceptTest {

        [TestMethod]
        public void TestToString() {
            DynamicPercept p = new DynamicPercept("key1", "value1");

            Assert.AreEqual("IPercept[key1==value1]", p.ToString());

            p = new DynamicPercept("key1", "value1", "key2", "value2");

            Assert.AreEqual("IPercept[key1==value1, key2==value2]", p.ToString());
        }

        [TestMethod]
        public void TestEquals() {
            var p1 = new DynamicPercept();
            var p2 = new DynamicPercept();

            Assert.AreEqual(p1, p2);

            p1 = new DynamicPercept("key1", "value1");

            Assert.AreNotSame(p1, p2);

            p2 = new DynamicPercept("key1", "value1");

            Assert.AreEqual(p1, p2);
        }
    }

}
